﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using LeakView.common;
using LeakView.service;

namespace LeakView.view
{
    public partial class ViewAlarm : UserControl, Splashable
    {


        public ViewAlarm()
        {
            InitializeComponent();
        }



        void Splashable.splash(bool flag)
        {
            Color alarmColor = flag ? Color.Transparent : Color.DarkRed;

            this.XL.BackColor = AlarmModal.me.AlarmForXL.IsAlarm ? alarmColor : Color.Transparent;
            this.LX.BackColor = AlarmModal.me.AlarmForLX.IsAlarm ? alarmColor : Color.Transparent;
            this.SC.BackColor = AlarmModal.me.AlarmForSC.IsAlarm ? alarmColor : Color.Transparent;
            this.YC.BackColor = AlarmModal.me.AlarmForYC.IsAlarm ? alarmColor : Color.Transparent;
            
        }

        private void XL_DoubleClick(object sender, EventArgs e)
        {
            AlarmModal.me.AlarmForXL.setMuted();
        }

        private void LX_DoubleClick(object sender, EventArgs e)
        {
            AlarmModal.me.AlarmForLX.setMuted();
        }

        private void SC_DoubleClick(object sender, EventArgs e)
        {
            AlarmModal.me.AlarmForSC.setMuted();
        }

        private void YC_DoubleClick(object sender, EventArgs e)
        {
            AlarmModal.me.AlarmForYC.setMuted();
        }
    }


}
